import request from '@/utils/request';

/**
 * 创建对话
 * POST /api/talking/create
 */
export async function createChat(data: API.CreateChatParam, options?: API.baseOption) {
  return request<API.HistoryContext>('/talking/create', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

/**
 * 获取数字员工列表
 * POST /api/dataStaff/enabledList
 */
export async function queryEmployeeList(data = {}, options?: API.baseOption) {
  return request<API.Employee[]>('/dataStaff/enabledList', {
    method: 'GET',
    data,
    ...(options || {}),
  });
}

/**
 * 用户对话历史主题
 * POST /api/talking/history
 */
export async function queryHistoryContext(data = {}, options?: API.baseOption) {
  return request<API.HistoryContext[]>('/talking/history', {
    method: 'GET',
    data,
    ...(options || {}),
  });
}

/**
 * 查询对话历史详情
 * POST /api/talking/{id}/detail
 */
export async function queryChatHistory(id: string, options?: API.baseOption) {
  return request<API.ChatHistory>(`/talking/${id}/detail`, {
    method: 'GET',
    ...(options || {}),
  });
}
